package com.myprocessing.box;

import processing.core.PConstants;

import com.myprocessing.box.TextBox.Overflow;
import com.myprocessing.gui.util.Font;
import com.myprocessing.gui.util.Coord;

public class StatusBox extends Box {

	protected TextBox textBox;
	protected Font font;
	protected float lineHeight = 12;
	
	public void init() {
		textBox = new TextBox(font, "", lineHeight,
				PConstants.LEFT, PConstants.BASELINE);
		textBox.setSize(new Coord(size.getX() - 6, size.getY() - 6));
		textBox.setPosition(new Coord(3,3));
		textBox.setOverflow(Overflow.SCROLL);
		addSubBox(textBox);
		super.init();
	}

	public TextBox getTextBox() {
		return textBox;
	}

	public void setTextBox(TextBox textBox) {
		this.textBox = textBox;
	}

	public Font getFont() {
		return font;
	}

	public void setFont(Font font) {
		this.font = font;
	}

	public float getLineHeight() {
		return lineHeight;
	}

	public void setLineHeight(float lineHeight) {
		this.lineHeight = lineHeight;
	}
	
	public void drawBox() {
		pApplet.fill(255);
		pApplet.stroke(0);
		pApplet.rect(0, 0, size.getX(), size.getY());
	}
	
	public void append(String str) {
		textBox.append(str);
	}
	
	public void clear() {
		textBox.clear();
	}
	
}
